{include file="header.html"}
<div>
  <ul class="nav nav-tabs">
    <li><a href="{$appadmin}?m=kucun">库存管理</a></li>
    <li class="active"><a href="#">库存授权</a></li>
  </ul>
  <div>当前库存：{$kucun.title}</div>
  
  
  <style>
  .sclist{}
  .sclist .hd{width:100%; height:30px; line-height:30px; border-bottom:1px solid #ccc; margin-bottom:5px;}
  .sclist .item{width:100%; margin-bottom:10px;}
  .sclist .item .scity{ text-align:center; width:100px; cursor:pointer; float:left; margin-right:10px;}
  .sclist .item .scity.active{background-color:#E0A421; color:#fff;}
  </style>
  <div class="sclist">
  	
   <div class="hd">站点列表</div>
    <div class="item">
    	 
       {foreach item=c from=$sclist}
        <div  class="scity {if $c.isdo} active {/if}" scid="{$c.siteid}">{$c.sitename}</div>
        {/foreach}
        
        <div class="clearfix"></div>
    </div>
   
  </div>
</div>
<script>
$(function(){
	$(".scity").on("click",function(){
		var  obj=$(this);
		var qx=0;
		var url;
		if($(this).hasClass("active")){
			url="{$appadmin}?m=kucun_area&ajax=1&a=qxshouquan";
			qx=1;
		}else{
			url="{$appadmin}?m=kucun_area&ajax=1&a=shouquan";
		}
		$.get(url,{kcid:{$kucun.kcid},siteid:$(this).attr("scid")},function(data){
			if(data.error){
				skyToast(data.message);
			}else{
				if(qx==1){
					obj.removeClass("active");
				}else{
					obj.addClass("active");
				}
			}
		},"json")
	});
});
</script>
{include file="footer.html"}